package com.hualan.sfzyproject.config;

import com.hualan.sfzyproject.interceptor.Interceptor01;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new Interceptor01())  //添加拦截器
                .addPathPatterns("/**");     //配置能够拦截的路径
//                .excludePathPatterns("*/login", "*/register");//配置不拦截的请求路径
    }
}
